package controller

import (
	"gin/common"
	"github.com/gin-gonic/gin"
)

//定义结构体
type Search struct {
	Id   int
	Name string
}

//结构体传参
func PostUserInfo(c *gin.Context) {
	//param := make(map[string]interface{})
	//err := c.BindJSON(&param)
	//if err == nil {
	//	ReturnSucess(c, 200, "sucess", param, 1)
	//	return
	//}
	//ReturnError(c, 500, gin.H{"err": err}, param, 1)

	search := &Search{}
	err := c.BindJSON(&search)
	if err == nil {
		common.ReturnSucess(c, 200, "请求成功", search, 1)
		return
	}
	common.ReturnError(c, 500, gin.H{"err": err}, search, 1)
}

func GetDb(c *gin.Context) {

}
